import {fang_office1} from "../api/office"
const IndexModel = {
  namespace: 'list',
  state: {
    TableList: [],
  },
  effects: {
    *INIT(action, { call, put }) {
      const data = yield call(fang_office1);
      yield put({ type: 'GETLIST', payload: data.data.data });
    },
  },
  reducers: {
    GETLIST(state, { payload }) {
      state.TableList = payload;
      return { ...state };
    },
    // DEL(state, { payload }) { 
    //   state.TableList.forEach((item, index) => {
    //     if (item.id === payload.id) {
    //       state.TableList.splice(index, 1);
    //     }
    //   });
    //   state.TableList=[...state.TableList]
    //   return { ...state };
    // },

  },
};

export default IndexModel;
